﻿<UserControl x:Class="BrainTechLLC.Upload.FileUploadControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:app="clr-namespace:BrainTechLLC.Upload"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <Style x:Key="TextStyle" TargetType="TextBlock">
            <Setter Property="Foreground" Value="#ff444444" />
            <Setter Property="FontSize" Value="12" />
        </Style>
        <Style x:Key="ButtonStyle" TargetType="Button">
            <Setter Property="Foreground" Value="#ff444444" />
            <Setter Property="FontSize" Value="12" />
        </Style>
        <Style x:Key="CheckBoxStyle" TargetType="CheckBox">
            <Setter Property="Foreground" Value="#ff444444" />
            <Setter Property="FontSize" Value="12" />
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" >
        <Border x:Name="controlBorder" CornerRadius="10" BorderBrush="#ff444444" BorderThickness="2">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0,0">
                    <GradientStop Color="#ffacacac"/>
                    <GradientStop Color="#ffc5c6c7" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid x:Name="fileUploadGrid">
                <Grid.RowDefinitions>
                    <RowDefinition Height="30" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="30" />
                    <RowDefinition Height="50" />
                </Grid.RowDefinitions>

                <Grid Grid.Row="0" VerticalAlignment="Bottom" Margin="10,0,18,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="60" />
                        <ColumnDefinition Width="60" />
                        <ColumnDefinition Width="100" />
                    </Grid.ColumnDefinitions>

                    <TextBlock Style="{StaticResource TextStyle}" Text="Name" Grid.Column="0" Margin="3" />
                    <TextBlock Style="{StaticResource TextStyle}" Text="Status" Grid.Column="1" Margin="3" />
                    <TextBlock Style="{StaticResource TextStyle}" Text="Size" Grid.Column="2" Margin="3" />
                    <TextBlock Style="{StaticResource TextStyle}" Text="Progress" Grid.Column="3" Margin="3" />
                </Grid>

                <ScrollViewer x:Name="filesScrollViewer" Grid.Row="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" Background="White">
                    <ItemsControl x:Name="fileList" >
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <app:FileUploadRowControl Margin="0,2"></app:FileUploadRowControl>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </ScrollViewer>

                <Grid Grid.Row="2" VerticalAlignment="Bottom" Margin="10,0,18,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="100" />
                    </Grid.ColumnDefinitions>

                    <TextBlock Style="{StaticResource TextStyle}" x:Name="countTextBlock" Text="Total: 0" Grid.Column="0" Margin="3" />
                    <TextBlock Style="{StaticResource TextStyle}" x:Name="totalSizeTextBlock" Grid.Column="1" Margin="3" HorizontalAlignment="Right" />
                    <Grid Grid.Column="2" Margin="3">
                        <ProgressBar x:Name="progressBar" Minimum="0" Grid.Column="2" />
                        <TextBlock x:Name="timeLeftTextBlock" Foreground="#ff444444" FontSize="10" Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" />
                    </Grid>

                </Grid>

                <StackPanel Orientation="Horizontal" Grid.Row="3" Height="30" VerticalAlignment="Center">
                    <Button x:Name="addFilesButton" Content="Select Files" Margin="5" Style="{StaticResource ButtonStyle}" />
                    <Button x:Name="uploadButton" Content="Upload" Margin="5" Style="{StaticResource ButtonStyle}" />
                    <Button x:Name="clearFilesButton" Content="Clear" Margin="5" Style="{StaticResource ButtonStyle}" />
                    <CheckBox x:Name="displayThumbailChckBox" Margin="5" Content="Display Thumbnails (files may be slow to load)?" Style="{StaticResource CheckBoxStyle}" />
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
